package com.gmail.at.dao;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.gmail.at.model.Passenger;

public interface PassengerDAO extends PagingAndSortingRepository<Passenger, Integer> {
	
	@Query("select p from Passenger p where p.login = :login")
    public Passenger findByLogin(@Param("login") String login);
	
	@Query("select p from Passenger p where p.passengerName = :name AND p.passengerSurname = :surname")
    public Passenger findByNameSurname(@Param("name") String name, @Param("surname") String surname);
}
